﻿namespace Medicalsystem.MCP.FormDesigner.Define
{
    public class Model
    {
        public Model(string modelID, DevExpress.XtraEditors.XtraForm modelForm)
        {
            _modelID = modelID;
            _modelForm = modelForm;

            //构造相关使用类型
            CreateControls();
        }

        private CtrlCollection _controls;
        private string _modelID;
        private DevExpress.XtraEditors.XtraForm _modelForm;

        public string ModelID
        {
            get { return _modelID; }
            set { _modelID = value; }
        }

        /// <summary>
        /// 控件集合
        /// </summary>
        public CtrlCollection Controls
        {
            get { return _controls; }
            set { _controls = value; }
        }

        public DevExpress.XtraEditors.XtraForm ModelForm
        {
            get { return _modelForm; }
            set { _modelForm = value; }
        }

        /// <summary>
        /// 设计时 需要重写该方法
        /// </summary>
        protected virtual void CreateControls()
        {
            _controls = new CtrlCollection(this);
        }
    }
}